/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

/**
 * 任务状态
 *
 * @since 2022/8/12
 */
export enum TaskState {
  WAITING = 'waiting',
  RUNNING = 'running',
  END = 'end',
  REJECT = 'reject',
  ERROR = 'error',
}

export const transitionMap: Map<TaskState, Set<TaskState>> = new Map([
  [TaskState.WAITING, new Set([TaskState.RUNNING, TaskState.REJECT])],
  [TaskState.RUNNING, new Set([TaskState.END, TaskState.ERROR])],
  [TaskState.END, new Set()],
  [TaskState.REJECT, new Set()],
  [TaskState.ERROR, new Set()],
]);
